home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_show / cecil / example8 / example.e < prev    next >
Text File  |  2000-03-25  |  563b  |  31 lines

  1. class EXAMPLE
  2.    --
  3.    -- This example shows how to create Eiffel objects from C.
  4.    --
  5.    -- To compile this example, use command :
  6.    --
  7.    --         compile -cecil cecil.se example c_prog.c
  8.    --
  9.  
  10. creation make
  11.  
  12. feature
  13.  
  14.    make is
  15.       local
  16.          c_factory: C_FACTORY;
  17.          string: STRING;
  18.       do
  19.          !!c_factory;
  20.          string := call_c_prog(c_factory);
  21.          io.put_string(string);
  22.          io.put_new_line;
  23.       end;
  24.  
  25.    call_c_prog(c_factory: C_FACTORY): STRING is
  26.       external "C"
  27.       alias "c_prog"
  28.       end;
  29.  
  30. end -- EXAMPLE
  31.